package com.jingyanzi.resallocation.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jingyanzi.resallocation.domain.ClubDO;
import com.jingyanzi.resallocation.result.ResultDO;
import com.jingyanzi.resallocation.result.ResultSupport;
import com.jingyanzi.resallocation.service.IClubService;

@RestController
@RequestMapping("/api")
public class ClubClientImpl implements ClubClientAPI {

	@Autowired
	private IClubService clubService;
	
	@Override
	@RequestMapping("/club/{id}")
	public ClubDO get(@PathVariable(value = "id") Integer id) {
		ResultDO result = clubService.get(id);
		return (ClubDO) result.getModel(ResultSupport.FIRST_MODEL_KEY);
	}

}
